package com.cskaoyan.controller;
/*
 * @author 魏骏杰
 */

import com.cskaoyan.bean.basebean.BaseRespVo;
import com.cskaoyan.bean.mini_program_storage_upload.UploadVo;
import com.cskaoyan.exception.MarketException;
import com.cskaoyan.service.MiniProgramStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("wx/storage")
public class MiniProgramStorageController {
    @Autowired
    MiniProgramStorageService miniProgramStorageService;

    @PostMapping("upload")
    public BaseRespVo upload(MultipartFile file) throws MarketException {
        UploadVo uploadVo = miniProgramStorageService.addStorage(file);
        return BaseRespVo.ok(uploadVo);
    }
}
